-- frost_halo
-- create by dengc
-- 冰霜光环

return {
    apply = function(source, target, skillId, round, para, extra)
        -- 威力
        local force = para[1];

        local maxHp = target:queryAttrib("max_hp");

        -- 属性对技能的加成
        local prop = PropM.combine(source, "increase_skill_effect", skillId);

        local v = source.dbase:query("increase_skill_effect") or 0;
        prop[3] = prop[3] - v;

        local rate = PropM.apply(prop, force);

        local damage = math.modf(rate * maxHp / 1000);

        -- 增加命中动作
        SkillM.getSequence(target):hit(source, target, skillId);

        -- 伤害
        CombatM.receiveDamage(source, target, damage, skillId, extra);

        return damage;
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), };
    end,
};
